package org.crackjack.android.util;

import android.util.Log;

public class Logger {

    private static final String APP_TAG = "org.jimotozka";

    public static void w(Class<?> clazz, String msg) {
        if (isLoggable(Log.ERROR)) {
            w(clazz, msg, null);
        }
    }

    public static void e(Class<?> clazz, String msg) {
        e(clazz, msg, null);
    }

    public static void e(Class<?> clazz, Throwable tr) {
        e(clazz, clazz.getSimpleName() + " : " + tr.getMessage(), tr);
    }

    public static void e(Class<?> clazz, String msg, Throwable tr) {
        if (isLoggable(Log.ERROR)) {
            Log.e(APP_TAG, clazz.getSimpleName() + " : " + msg, tr);
        }
    }

    public static void w(Class<?> clazz, String msg, Throwable tr) {
        if (isLoggable(Log.WARN)) {
            Log.w(APP_TAG, clazz.getSimpleName() + " : " + msg, tr);
        }
    }

    public static void i(Class<?> clazz, String msg) {
        if (isLoggable(Log.INFO)) {
            Log.i(APP_TAG, clazz.getSimpleName() + " : " + msg);
        }
    }

    public static void d(Class<?> clazz, String msg) {
        if (isLoggable(Log.DEBUG)) {
            Log.d(APP_TAG, clazz.getSimpleName() + " : " + msg);
        }
    }

    public static void log(Class<?> clazz, String msg, Throwable th) {
        if (isLoggable(Log.WARN)) {
            Log.i(APP_TAG, clazz.getSimpleName() + " : " + msg);
        }
    }

    public static boolean isLoggable(int level) {
        return true;
    }

}
